<g:setProvider library="jquery"/>

<div class="body">
    <h1>Edit User</h1>
    <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${userInstance}">
    <div class="errors">
        <g:renderErrors bean="${userInstance}" as="list" />
    </div>
    </g:hasErrors>
    <g:form method="post" >
        <input type="hidden" name="id" value="${userInstance?.id}" />
        <input type="hidden" name="version" value="${userInstance?.version}" />
        <div class="dialog">
            <table>
                <tbody>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="name">Name:</label>
                        </td>
                        <td valign="top" class="value ${hasErrors(bean:userInstance,field:'name','errors')}">
                            <input type="text" id="name" name="name" value="${fieldValue(bean:userInstance,field:'name')}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="lastName">Last Name:</label>
                        </td>
                        <td valign="top" class="value ${hasErrors(bean:userInstance,field:'lastName','errors')}">
                            <input type="text" id="lastName" name="lastName" value="${fieldValue(bean:userInstance,field:'lastName')}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="alias">Alias:</label>
                        </td>
                        <td valign="top" class="value ${hasErrors(bean:userInstance,field:'alias','errors')}">
                            <input type="text" id="alias" name="alias" value="${fieldValue(bean:userInstance,field:'alias')}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="email">Email:</label>
                        </td>
                        <td valign="top" class="value ${hasErrors(bean:userInstance,field:'email','errors')}">
                            <input type="text" id="email" name="email" value="${fieldValue(bean:userInstance,field:'email')}"/>
                        </td>
                    </tr>

                </tbody>
            </table>
        </div>
        <div class="buttons">
            <span class="button"><g:actionSubmit class="save" value="Update" /></span>
            <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
        </div>
    </g:form>
</div>

